package com.example.hander;

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

/**
 * 自动填充插件
 * @author song
 * @since 2021-08-08 18:50:36
 */

@Component
public class MyMeateObjectHander implements MetaObjectHandler {
    /**
     * 配置自动填充
     */
    @Override
    public void insertFill(MetaObject metaObject) {
        this.setFieldValByName("pwd","123456",metaObject);
        this.setFieldValByName("deleted","0",metaObject);
    }
    /**
     *  配置修改填充
     */
    @Override
    public void updateFill(MetaObject metaObject) {

    }
}
